<?php 
defined('IN_ADMIN') or exit('No permission resources.');
include $this->admin_tpl('header', 'admin');
?>
<div class="pad-10">
<form method="post" action="?m=pointcard&c=admin_pointcard&a=bind&pid=<?php echo $_GET['pid']?>" name="myform" id="myform">
<table class="table_form" width="100%">
<tbody>
	<tr>
		<th width="100"><?php echo L('pointcard_card_no')?></th>
		<td><?php echo htmlspecialchars($pc_info['card_sn'])?></td>
	</tr>
	<tr>
		<th width="100"><?php echo L('pointcard_card_pwd')?></th>
		<td><?php echo htmlspecialchars($pc_info['card_pwd'])?></td>
	</tr>
	<tr>
		<th><?php echo L('pointcard_endtime')?>：</th>
		<td><?php echo $pc_info['format_endtime']?></td>
	</tr>
	<tr>
		<th><?php echo L('bind_username')?>：</th>
		<td><input name="bind_username" id="bind_username" class="input-text" type="text" size="50" ></td>
	</tr>
	<tr>
		<th><?php echo L('bind_userid')?>：</th>
		<td><input name="pointcard[owner_uid]" id="owner_uid" class="input-text" type="text" size="50" readonly="readonly" ></td>
	</tr>
    </tbody>
</table>
<input type="submit" name="dosubmit" id="dosubmit" value=" <?php echo L('ok')?> " class="dialog">&nbsp;<input type="reset" class="dialog" value=" <?php echo L('clear')?> ">
</form>
</div>
</body>
</html>
<script type="text/javascript">
$(document).ready(function(){
	$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'220',height:'70'}, function(){this.close();$(obj).focus();})}});
	$('#bind_username').formValidator({onshow:"<?php echo L('input_bind_username')?>",onfocus:"<?php echo L('input_bind_username')?>",oncorrect:"<?php echo L('right')?>"}).inputValidator({min:1,onerror:"<?php echo L('bind_username_cannot_empty')?>"}).ajaxValidator({type:"get",url:"",data:"m=pointcard&c=admin_pointcard&a=get_bind_username",datatype:"html",cached:false,async:'true',success : function(data) {
        if( data > "0" )
		{
			$('#owner_uid').val(data);
            return true;
		}
        else
		{
			$('#owner_uid').val('');
            return false;
		}
	},
	error: function(){alert("<?php echo L('server_no_data')?>");},
	onerror : "<?php echo L('bind_username_nnot_exist')?>",
	onwait : "<?php echo L('checking')?>"
	}).defaultPassed();
});
</script>